package com.kaifamiao.regular;

import java.util.Arrays;

public class HelloRegular {

    public static void main(String[] args) {

        // final String regex = "\\d+"; // [0-9]
        final String regex = "[0-9]{11}";

        String str = "18812344321";
        // 判断 str 指向的字符串 是否匹配于 指定的正则表达式 regex
        System.out.println( str.matches( regex ) );

        final String source = "杨某俊123李某芳456王某琴789王某人123菲尔那234何某艳";

        String[] names = source.split( "\\d{3}" );
        System.out.println( Arrays.toString( names ) );

        String result = source.replaceAll( "\\d{3}" , "," );
        System.out.println( result );

    }

}
